package work.linruchang.util;

import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.RandomUtil;
import com.forte.util.utils.MockUtil;

/**
 * @author LinRuChang
 * @version 1.0
 * @date 2022/10/09
 * @since 1.8
 **/
public class EnhanceRandomUtil extends RandomUtil {


    public static Object[] nums(Class numberType, Integer numCount) {
        Object[] randomNumsResult = new Object[numCount];
        for (int index = 0; index < numCount; index++) {
            randomNumsResult[index] = Convert.convert(numberType, randomLong());
        }
        return randomNumsResult;
    }

    public static Object[] dates(Class numberType, Integer dateCount) {
        Object[] datesResult = new Object[dateCount];
        for(int index = 0; index < dateCount; index++) {
            datesResult[index]  = Convert.convert(numberType, MockUtil.date());
        }
        return datesResult;
    }

    public static Boolean[] bools(Integer booleanCount) {
        Boolean[] result = new Boolean[booleanCount];
        for(int index = 0; index < booleanCount; index++) {
            result[index] = randomBoolean();
        }
        return result;
    }

    public static Character[] characters(Integer charactersCount) {
        Character[] result = new Character[charactersCount];
        for(int index = 0; index < charactersCount; index++) {
            result[index] = MockUtil.character();
        }
        return result;
    }
}
